import os

del_dr = '/home/xag/dataset/1123/JPEGImages/'
error_dr = '/home/xag/dataset/error/'
for p in os.listdir(error_dr):
    os.remove(os.path.join(del_dr, p))